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