UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4WkPZkK9BpLkiDr2fgHs0puft+4poCUDS+v5112PFnU=' 
WHERE 
  key_id = '07f53b05e7bf5905a64ca8c002bcc7a39ca1fbc28296c4f164ef0541a5545fb5' 
  AND (
    token = '4WkPZkK9BpLkiDr2fgHs0puft+4poCUDS+v5112PFnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030