UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YeIFjbmlqbNa3hapmNzYqYMcnrsU6vDlFPUjvqzZavA='
WHERE
key_id = '2755384700a96f73c79871687ac3b91b9aeb8af16851f0444a3d40a04d71b2c6'
AND (
token = 'YeIFjbmlqbNa3hapmNzYqYMcnrsU6vDlFPUjvqzZavA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)