UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qRUzmFEIq0yPwSzuc1YeknBIlsSyekZoY9+flSFsJMY=' 
WHERE 
  key_id = '4db4c73cc93fc4bba24d4bcea0f910b3053590941659b165a1a6253eb29b05f2' 
  AND (
    token = 'qRUzmFEIq0yPwSzuc1YeknBIlsSyekZoY9+flSFsJMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030