UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1PuPHuQc/tyvVcwFs+3JT23r4jQQwUdVq4PCtwu5HSk='
WHERE
key_id = 'ce6be0a8102c33a6114b57a29b5a57074fc6edfcbba67c9700bfb43044a30053'
AND (
token = '1PuPHuQc/tyvVcwFs+3JT23r4jQQwUdVq4PCtwu5HSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)