UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pYUyDsp1m145DXLLXaiWjDsM+W1wejlNcNeqdUDpV3Y='
WHERE
key_id = '42e31822c5a15af223716ae32fc83ccb4af8e2116bd83ec03063219fdf6e98df'
AND (
token = 'pYUyDsp1m145DXLLXaiWjDsM+W1wejlNcNeqdUDpV3Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)