UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rSPkSfcE3H40BlC7wHVpbEj0Kh/XJnQoYkIKRqpSZMI='
WHERE
key_id = '05fef419616803fc4ed9a4c4c6ee4ab5bd1425f4dd5d63858a30b78dd2ce5e0c'
AND (
token = 'rSPkSfcE3H40BlC7wHVpbEj0Kh/XJnQoYkIKRqpSZMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)