UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zkg3TkTvDchCRvV5w1VT/pIVZ7iWMwL5XBAENtPU97I=' 
WHERE 
  key_id = 'c9bd53d4810bab7f5d369aa6a1b1e632645e4b6cba5453300477c0ba5d088d97' 
  AND (
    token = 'Zkg3TkTvDchCRvV5w1VT/pIVZ7iWMwL5XBAENtPU97I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031