UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yGEBHV9FWpWKazHvlRTJwBFNmmyCY5apwygM9nVYuFM='
WHERE
key_id = 'ee1fce10416ded4dc0282adca54480fdc6426214fe0dd759efac79a85cd2894b'
AND (
token = 'yGEBHV9FWpWKazHvlRTJwBFNmmyCY5apwygM9nVYuFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)