UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M1Yr/Efsl812J3Z7xIU8uO8VyLu8dyvl5nz/YynlnZE='
WHERE
key_id = 'c913cd97229958508a299f10976e6e8129a7ac3ee14472e11d6051478ec8cb11'
AND (
token = 'M1Yr/Efsl812J3Z7xIU8uO8VyLu8dyvl5nz/YynlnZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)