UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O3fCOpLChAzt2R8Q9akOP6s1/M8eyasy6T6nZmWhWgY='
WHERE
key_id = '52ba2e815e19f304d1347094f1ce75d94dbd76b5623861012ab752f057e12b26'
AND (
token = 'O3fCOpLChAzt2R8Q9akOP6s1/M8eyasy6T6nZmWhWgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)