UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZnIyNJCzpRBGC7eqK0+xeIQfGQuMaStUz9vEo+h7/dE=' 
WHERE 
  key_id = 'e9cc775cdb73636b2150ce1c7797538467c6ee113dd9feb9c166a992ccae8ca0' 
  AND (
    token = 'ZnIyNJCzpRBGC7eqK0+xeIQfGQuMaStUz9vEo+h7/dE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026