UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lsh27EHLw0gQymvLNL5FglrmJz1t/7aHsoA1W9LWUHY='
WHERE
key_id = '1b9b896faea081a70c41e42ef7397ab19302542e99ba0db9ded6652bc5b34419'
AND (
token = 'Lsh27EHLw0gQymvLNL5FglrmJz1t/7aHsoA1W9LWUHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)