UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FDVpKp8Q0PoY2QZkYwZEGQ+TFdelzyR/grdJVYJiT+M='
WHERE
key_id = 'bdefe8212f13661b900059b6fb1d8d30feb0f978ae03c8d5aeb57a40f0ce2c8f'
AND (
token = 'FDVpKp8Q0PoY2QZkYwZEGQ+TFdelzyR/grdJVYJiT+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)