UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EQEFOOGCIe50KQpmB/uaw+kN2dt2GXAKCeiMgZv1n34='
WHERE
key_id = '36902a2ef54db11abc64a183a2577ef905f6b16ed622271b306c3443617f5d5c'
AND (
token = 'EQEFOOGCIe50KQpmB/uaw+kN2dt2GXAKCeiMgZv1n34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)