UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KTt+GY84WFpgubK1PbhktNbbAtwMDvdMeIhRbRdsym4='
WHERE
key_id = 'a757b395389900110f5684e1e10e303cf2525af8e68d67b58233d00014b621f5'
AND (
token = 'KTt+GY84WFpgubK1PbhktNbbAtwMDvdMeIhRbRdsym4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)