UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '59HCW6q9G2r0BFWa/C92noQioAxDpcPU3FuZ1t2MVpc='
WHERE
key_id = '04350f114be4fd01dc665b6cee53fba1ff89c15d1302f8dea63abf57ee6745c3'
AND (
token = '59HCW6q9G2r0BFWa/C92noQioAxDpcPU3FuZ1t2MVpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)