UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oYTJVqrW+GUcdp/bmqLr3nn/m1+MWBdpOnhxPym30+I='
WHERE
key_id = '3dfe749d87ac1594ac8f021a43b0014c5239ab75ae84b426aea2fa8116268064'
AND (
token = 'oYTJVqrW+GUcdp/bmqLr3nn/m1+MWBdpOnhxPym30+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)