UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AdLYoPDyjEhS0//bNHnGCT/O0jOC8uF6VxorHPE3PGQ='
WHERE
key_id = 'dda6fe86cf2da453186cb5b9a8e77ff3dfb1743459f334fbcfa5a2622e1b77c8'
AND (
token = 'AdLYoPDyjEhS0//bNHnGCT/O0jOC8uF6VxorHPE3PGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)