UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eGb0F2jXAuk3a1GLj6LNhbzsHq6utXLfFOKJw3LSzWw=' 
WHERE 
  key_id = '7c075f0c1946f058c12d672a1ec4927f2d9a2eafb3353267208c5790b2e525b1' 
  AND (
    token = 'eGb0F2jXAuk3a1GLj6LNhbzsHq6utXLfFOKJw3LSzWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029