UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WSgKUlweb43kL+K3ABvHJiWb5x7kDRtKy4ffIca4d28='
WHERE
key_id = 'f4dd5203374005b5c5b3e4a17a02879db3a7dd03beac373d553be42ba7dc438f'
AND (
token = 'WSgKUlweb43kL+K3ABvHJiWb5x7kDRtKy4ffIca4d28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)