UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S/ty5A/eIiTTLeABQJfCVhlIrfxBNtGFB31vfZCo1bA='
WHERE
key_id = '89001d1ae9e6e0d4f4de149bf9fe19b7a0da483bb762ded4fcd25ed5768cd408'
AND (
token = 'S/ty5A/eIiTTLeABQJfCVhlIrfxBNtGFB31vfZCo1bA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)