UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '67pfiZlC7nmmm/kOFlsMFmfockWWQea0hN0wRNmNK9Y=' 
WHERE 
  key_id = '4b13db1929f34024f6b13e796325004f655790466ad8a5d1002401045bfa02b5' 
  AND (
    token = '67pfiZlC7nmmm/kOFlsMFmfockWWQea0hN0wRNmNK9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041