UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PveR0b2NvC5gI9I9bkbDaP4RNNYAktNvkb/qPIURgug=' 
WHERE 
  key_id = '4e3c6a720275c5d9019acbaa25d3d30814a88e948ea2440f44cea64d1f73377e' 
  AND (
    token = 'PveR0b2NvC5gI9I9bkbDaP4RNNYAktNvkb/qPIURgug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033