UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4hicLGRnVv4W1V/AUegjRTlTNS43py9dswLEJuHfIv4=' 
WHERE 
  key_id = 'b2355b77fac7dbb0ea9931403492fbe0d5d469954e7664e6e5cc96adcfbaa358' 
  AND (
    token = '4hicLGRnVv4W1V/AUegjRTlTNS43py9dswLEJuHfIv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00085