UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wrONdz3JVj5C4oFtdK8kLch+FGjg0mG5bqbgMOc2cco='
WHERE
key_id = 'ff97b60f8b40205c5ebd08275c05cea624682a10fc66ae9f6cd95a96915da603'
AND (
token = 'wrONdz3JVj5C4oFtdK8kLch+FGjg0mG5bqbgMOc2cco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)