UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sopeJRxGr1LestO13f7AMKRpJcadVqdxJC4RaZn5rZY='
WHERE
key_id = '11d1e492f94a1e68733228a438e025a3204ba35e0ecde672b3cefb381608e475'
AND (
token = 'sopeJRxGr1LestO13f7AMKRpJcadVqdxJC4RaZn5rZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)