UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D9s2xAUqR72EBvQNdzlWJnV2wyQBH/gPtTixi9sj6rk=' 
WHERE 
  key_id = '611efb70cb0b723dd85a550fe0e5f06fada6f9c6c59cca28c1e7cb3391159145' 
  AND (
    token = 'D9s2xAUqR72EBvQNdzlWJnV2wyQBH/gPtTixi9sj6rk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041