UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vO9OQ0hAER6t5je7TxRXyIjSPx+z8863iRL0jsHvRq4='
WHERE
key_id = 'e713f8b397dafdf4f3d5205c28d578dc0fd4cd67b5cb1123ff9dfefb1377cb4d'
AND (
token = 'vO9OQ0hAER6t5je7TxRXyIjSPx+z8863iRL0jsHvRq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)