UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k1aTOrozJCjmyvGB/mHIBynxcHIyDvDm1uMatW+Q4w0=' 
WHERE 
  key_id = '7b70c10d817312495a06e4b7e788bc25ba223fbdc36ac4783bcd78bef2db9bed' 
  AND (
    token = 'k1aTOrozJCjmyvGB/mHIBynxcHIyDvDm1uMatW+Q4w0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032