UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FZe3AtImqyWTVy8g0Nz9QMbmdN4a/pF3UejNB80V3CM=' 
WHERE 
  key_id = '75d26053f4fba59a1770daffa5f95573627a3f551600ab660c346e40992e0d50' 
  AND (
    token = 'FZe3AtImqyWTVy8g0Nz9QMbmdN4a/pF3UejNB80V3CM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034