UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nOR1D+yaPrrlF1NFwN9gI32YAsMY+vu0Wl5D844h6cQ='
WHERE
key_id = '626b8842fdaea1d26dd03e3f25c72f261d40e84998c29bc4fa11aff3730f3dcc'
AND (
token = 'nOR1D+yaPrrlF1NFwN9gI32YAsMY+vu0Wl5D844h6cQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)