UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q6Wm2v+hHXKmRNa/mxYSmx6WG0ifLinciqk2dS/B2SY=' 
WHERE 
  key_id = 'a70c4bd0eedb55895700201e9f2984c30cf149d158881df1498d6b283b4b7c5d' 
  AND (
    token = 'Q6Wm2v+hHXKmRNa/mxYSmx6WG0ifLinciqk2dS/B2SY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038