UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j14abduP5UMsCcB2bhvzWWLlEunLgRLaxxobGW1QuBY='
WHERE
key_id = '2e1dfa96dfa99c3936a0f05eb53215e7abd7598394a8e19cdd96196b6df1f39b'
AND (
token = 'j14abduP5UMsCcB2bhvzWWLlEunLgRLaxxobGW1QuBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)