UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JJBRKN18ohUn+WFgC4pwlTIhKp/y1jjOAD0PPf0XdMU='
WHERE
key_id = 'b11edeed09217ff55398217c2ca09b593874624552bf5384cb3fb45346b7fcc0'
AND (
token = 'JJBRKN18ohUn+WFgC4pwlTIhKp/y1jjOAD0PPf0XdMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)