UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8NmzPJz+c5AagZeaEUNxuR+dRJ5fH+YAf8IwOUbbMIA='
WHERE
key_id = '6b57b2dbc9fa5594cc460e026632f7a033f28d6e26e71b4e19855325a98cdbae'
AND (
token = '8NmzPJz+c5AagZeaEUNxuR+dRJ5fH+YAf8IwOUbbMIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)