UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1hs2+mxk6Z2oebM30RaHfy5AE5+qmOZYlVT6U93QstQ=' 
WHERE 
  key_id = 'b01d7abc3f3d68d3c540184828f32c70a36989320c682e9b57c80fc8ffe3d176' 
  AND (
    token = '1hs2+mxk6Z2oebM30RaHfy5AE5+qmOZYlVT6U93QstQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049