UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFqLf5VyYVv/pFcEtwhsPbNxuaLkomq2tu6+RoKs4io=' 
WHERE 
  key_id = 'eee531436027b36ff796bf24876075b2f7c2eec1e259d7b173b1ece4446fe75d' 
  AND (
    token = 'kFqLf5VyYVv/pFcEtwhsPbNxuaLkomq2tu6+RoKs4io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033