UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wHArUiDEDysL8IXwEkuqvP43zIvL/zoG3KeclOrBzPQ=' 
WHERE 
  key_id = '8f2fbabb8a56c6b89967ac80a5bbf902af75d768eaae7a7bc7ff95d41ea8b1ee' 
  AND (
    token = 'wHArUiDEDysL8IXwEkuqvP43zIvL/zoG3KeclOrBzPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035