UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UdVON7FnJFXSi6xpWYG9WzlR2lkuHcrEM1Om3+Wdrro='
WHERE
key_id = 'c93a8693892fdda738afc6c12a7118c90d32dc4a6be53fd93a556f9390f11448'
AND (
token = 'UdVON7FnJFXSi6xpWYG9WzlR2lkuHcrEM1Om3+Wdrro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)