UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jooVbc3RRkPc9f37bF1m4y7v58j6zBAWQG1Z3VA/i/k=' 
WHERE 
  key_id = '04cb364520d9406ab5d37edcbe7598c8a927b43646c0b1b0103f54e670ee28ba' 
  AND (
    token = 'jooVbc3RRkPc9f37bF1m4y7v58j6zBAWQG1Z3VA/i/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034