UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9E7oyX19lmOhIzAqpVcSlKpSq/1Qev2YaVL9wxqbIPg=' 
WHERE 
  key_id = '2f94f38c14b8509de2fd5f99b6617db5976450e9a74ae015f2367490123b223e' 
  AND (
    token = '9E7oyX19lmOhIzAqpVcSlKpSq/1Qev2YaVL9wxqbIPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037