UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gg/tNbxk8ZOoGv/3JgJb9+RVCDR7DfZq8AqcG+3xVeI=' 
WHERE 
  key_id = '7bf1ff67bce776b798723b750dc316670f1f2e340cf30b3757a28534320d7d72' 
  AND (
    token = 'Gg/tNbxk8ZOoGv/3JgJb9+RVCDR7DfZq8AqcG+3xVeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047